<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Date" %><%--
  Created by IntelliJ IDEA.
  User: LENOVO
  Date: 2020/8/23
  Time: 9:14
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>商品遍历</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.0/dist/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk"
          crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj"
            crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
            crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.0/dist/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI"
            crossorigin="anonymous"></script>
    <script src="js/js1.js"></script>
    <script src="js/vue.js"></script>
    <link rel="stylesheet" type="text/css" href="css/show.css"/>
</head>
<body>
<div class="mes">
    艺术商品
</div>
<div id="pr1">
    <div class="main">
        <c:forEach items="${requestScope.pageModelMenu.pageData}" var="goods">
            <div class="sp1"  >
                <a cursor="pointer" href="homePage?method=comm_datils&goods_id=${goods.goods_id}" target="_blank" >
                    <img src="${goods.goods_picture}"/>
                    <br>
                    <h6 style="color: darkred;padding-top:20px;">${goods.goods_name}</h6>
                </a>
                <span  >起&nbsp;&nbsp;拍&nbsp;价：<span style="color: red;font-size: 14px"><fmt:formatNumber value="${goods.low_price }" pattern="￥,000.00" ></fmt:formatNumber> </span></span><br>
                <span >起拍时间：</span><span style="color: black"><fmt:formatDate value="${goods.start_time}" pattern="YYYY-MM-dd hh:mm:ss"></fmt:formatDate></span><br>
                <span >
                    </span><span >截止时间：<fmt:formatDate  value="${goods.end_time}" pattern="YYYY-MM-dd hh:mm:ss"></fmt:formatDate>
							<br>
						<span>类&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 别：${goods.first_cname }-${goods.second_cname}</span>
				        <div class="sum">
                            <strong><span style="color:white;font-size: 20px">${goods.auction_times}</span><br></strong>
                            <span>次竞拍</span>
                        </div>
						<%
							SimpleDateFormat sdf = new SimpleDateFormat("YYYY-MM-dd hh:mm:ss");
        					String now = sdf.format(new Date());
        					session.setAttribute("time_compare",now);
						%>
						<c:choose>
							<c:when test="${goods.end_time le time_compare}">
								<c:if test="${goods.auction_times==0}">
									<p class="web-font1 lp">流拍</p>
								</c:if>
								<c:if test="${goods.auction_times>0}">
									<p class="web-font1 lp">已完成</p>
								</c:if>
							</c:when>
                            <c:when test="${goods.start_time gt time_compare}">
                                <p class="web-font1 lp" style="background-color: blue" >未开始</p>
                            </c:when>
							<c:otherwise>
								<p class="web-font1 jp" >竞拍中</p>
							</c:otherwise>
						</c:choose>
                <p class="sp_ck"><a a cursor="pointer" href="homePage?method=comm_datils&goods_id=${goods.goods_id}" target="_blank">查看更多 > > ></a> </p>

            </div>
        </c:forEach>
    </div>
</div>

<ul class="page" >
    <li><a href="homePage?method=homepage_list&p=1">首页</a></li>
    <li><a href="homePage?method=homepage_list&p=${pageModelMenu.hasPreviousPage?pageModelMenu.page-1:1 }">上页</a></li>
    <c:forEach begin="1" end="${pageModelMenu.totalPages }" var="pno" step="1">
        <li ${pno==pageModelMenu.page?"class='active'":"" }>
            <a href="homePage?method=homepage_list&p=${pno }">${pno }</a>
        </li>
    </c:forEach>
    <li><a href="homePage?method=homepage_list&p=${pageModelMenu.hasNextPage?pageModelMenu.page+1:pageModelMenu.totalPages }">下页</a></li>
    <li><a href="homePage?method=homepage_list&p=${pageModelMenu.totalPages }">尾页</a></li>
</ul>
</body>
</html>
